package com.session2;

import javax.swing.JFrame;
import javax.swing.JScrollPane;
import javax.swing.JTextArea;

public class JScrollPanelDemo extends JFrame{
	private JTextArea txtNote;
	public void JScrollPanelDemo(){
		
	}
	public void createFrom(){
		this.txtNote = new JTextArea();
		//dua textArea vao ScrollPane
		JScrollPane pane = new JScrollPane(txtNote);
		pane.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
		// dua ScrollPane vao contennar
		this.getContentPane().add(pane);
	}
	public void showForm(){
		this.setTitle("Demo");
		this.setSize(400,300);
		this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		this.setVisible(true);
	}
	public static void main(String[] args) {
		JScrollPanelDemo j = new JScrollPanelDemo();
		j.createFrom();
		j.showForm();
	}
}
